package com.springboot.cloud.sysapps.exam.rest;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.sysapps.exam.service.IModuleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/module")
@Api("module")
@Slf4j
public class ModuleController {

    @Autowired
    private IModuleService moduleService;

    @ApiOperation(value = "根据subjectId获取所有模块", notes = "根据subjectId获取所有模块")
    @GetMapping("/all/{subjectId}")
    public Result allBySubjectId(@PathVariable("subjectId") String subjectId){
        return Result.success(moduleService.findBySubjectId(subjectId));
    }
}
